<?php

declare(strict_types=1);

namespace ImiApp\ApiServer\Api\Model\Base;

use Imi\Config\Annotation\ConfigValue;
use Imi\Model\Annotation\Column;
use Imi\Model\Annotation\DDL;
use Imi\Model\Annotation\Entity;
use Imi\Model\Annotation\Table;
use ImiApp\ImiServer\AbstractModel as Model;

/**
 * 售后退款类型 基类.
 *
 * @Entity(camel=false, bean=true, incrUpdate=false)
 * @Table(name=@ConfigValue(name="@app.models.ImiApp\ApiServer\Api\Model\Aftertype.name", default="fa_aftertype"), usePrefix=false, id={"id"}, dbPoolName=@ConfigValue(name="@app.models.ImiApp\ApiServer\Api\Model\Aftertype.poolName"))
 * @DDL(sql="CREATE TABLE `fa_aftertype` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) DEFAULT NULL COMMENT '原因',
  `weigh` int(10) DEFAULT NULL,
  `type_status` enum('refund','return','other') DEFAULT NULL COMMENT '类型:refund=退款,return=退货,other=其他',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='售后退款类型'", decode="")
 *
 * @property int|null $id 
 * @property string|null $name 原因
 * @property int|null $weigh 
 * @property string|null $typeStatus 类型:refund=退款,return=退货,other=其他
 */
abstract class AftertypeBase extends Model
{
    /**
     * {@inheritdoc}
     */
    public const PRIMARY_KEY = 'id';

    /**
     * {@inheritdoc}
     */
    public const PRIMARY_KEYS = ["id"];

    /**
     * id.
     * @Column(name="id", type="int", length=10, accuracy=0, nullable=false, default="", isPrimaryKey=true, primaryKeyIndex=0, isAutoIncrement=true, unsigned=true, virtual=false)
     * @var int|null
     */
    protected ?int $id = NULL;

    /**
     * 获取 id.
     *
     * @return int|null
     */
    public function getId(): ?int
    {
        return $this->id;
    }

    /**
     * 赋值 id.
     * @param int|null $id id
     * @return static
     */
    public function setId($id)
    {
        $this->id = null === $id ? null : (int)$id;
        return $this;
    }

    /**
     * 原因.
     * name
     * @Column(name="name", type="varchar", length=255, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var string|null
     */
    protected ?string $name = NULL;

    /**
     * 获取 name - 原因.
     *
     * @return string|null
     */
    public function getName(): ?string
    {
        return $this->name;
    }

    /**
     * 赋值 name - 原因.
     * @param string|null $name name
     * @return static
     */
    public function setName($name)
    {
        $this->name = null === $name ? null : (string)$name;
        return $this;
    }

    /**
     * weigh.
     * @Column(name="weigh", type="int", length=10, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var int|null
     */
    protected ?int $weigh = NULL;

    /**
     * 获取 weigh.
     *
     * @return int|null
     */
    public function getWeigh(): ?int
    {
        return $this->weigh;
    }

    /**
     * 赋值 weigh.
     * @param int|null $weigh weigh
     * @return static
     */
    public function setWeigh($weigh)
    {
        $this->weigh = null === $weigh ? null : (int)$weigh;
        return $this;
    }

    /**
     * 类型:refund=退款,return=退货,other=其他.
     * type_status
     * @Column(name="type_status", type="enum", length=0, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var string|null
     */
    protected ?string $typeStatus = NULL;

    /**
     * 获取 typeStatus - 类型:refund=退款,return=退货,other=其他.
     *
     * @return string|null
     */
    public function getTypeStatus(): ?string
    {
        return $this->typeStatus;
    }

    /**
     * 赋值 typeStatus - 类型:refund=退款,return=退货,other=其他.
     * @param string|null $typeStatus type_status
     * @return static
     */
    public function setTypeStatus($typeStatus)
    {
        $this->typeStatus = null === $typeStatus ? null : (string)$typeStatus;
        return $this;
    }

}
